package com.kefu.exam.vo;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.vo.AbstractSearchVo;
import com.kefu.exam.model.ExamPaperAnswer;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author xy
 * @date 2022/02/28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "答题卡答案表")
public class ExamPaperAnswerSearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "试卷ID")
    private String paperId;
    @ApiModelProperty(value = "答案ID")
    private String answerId;
    @ApiModelProperty(value = "试题ID")
    private String subjectId;

	 @Override
    public  LambdaQueryWrapper<ExamPaperAnswer> lambdaQuery(){
    	LambdaQueryWrapper<ExamPaperAnswer> wrapper=Wrappers.<ExamPaperAnswer>lambdaQuery();
	    wrapper.eq(StringUtils.isNotBlank(paperId), ExamPaperAnswer::getPaperId, paperId);//答题卡
	    wrapper.eq(StringUtils.isNotBlank(answerId), ExamPaperAnswer::getAnswerId, answerId);//答案ID
	    wrapper.eq(StringUtils.isNotBlank(subjectId), ExamPaperAnswer::getSubjectId, subjectId);//试题版本ID
    	return wrapper;
	}
}